package com.kgc.scd.service;

import com.kgc.scd.util.PageSupport;
import com.kgc.scd.vo.NideshopCollectVO;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Created On : 2022/11/14.
 * <p>
 * Author : yantao
 * <p>
 * Description: CollectServerService
 */

@FeignClient("wyyxmall-yt-server")
public interface CollectServerService {

    /**
     * @author : yantao
     * @date   : 2022/11/18
     * @param  : [pageNo, pageSize, name, userId]
     * @return : com.kgc.scd.util.PageSupport<com.kgc.scd.vo.NideshopCollectVO>
     * @description : 查询所有的收藏
     */
    @GetMapping("/ytserver/getCollectAll")
    PageSupport<NideshopCollectVO> getCollectAll(@RequestParam("pageNo") Integer pageNo,
                                                 @RequestParam("pageSize") Integer pageSize,
                                                 @RequestParam("name") String name,
                                                 @RequestParam("userId") String userId);


    /**
     * @author : yantao
     * @date   : 2022/11/18
     * @param  : [userId, goodsId]
     * @return : boolean
     * @description : 查看收藏的状态
     */
    @GetMapping("/ytserver/testIsCollect")
    boolean isCollect(@RequestParam("userId") String userId,
                      @RequestParam("goodsId") String goodsId);

    /**
     * @author : yantao
     * @date   : 2022/11/18
     * @param  : [userId, goodsId]
     * @return : boolean
     * @description : 删除收藏
     */
    @GetMapping("/ytserver/deleteCollection")
    boolean cancelCollection(@RequestParam("userId") String userId,
                              @RequestParam("goodsId") String goodsId);

    /**
     * @author : yantao
     * @date   : 2022/11/18
     * @param  : [userId, goodsId]
     * @return : boolean
     * @description : 添加收藏
     */
    @GetMapping("/ytserver/doCollect")
    boolean addCollection(@RequestParam("userId") String userId,
                             @RequestParam("goodsId") String goodsId);

}
